import request from '@/utils/request'

  //获取产品告警规则元数据
  export const editWarning = (productId) => {
    return request({
      url: '/resource/product​/warning/detail​/' + productId,
      method: 'get'
    })
  }
  

  //获取告警列表
  export const list = (query) => {
    return request({
      url: '/resource​/product/warning/page',
      method: 'get',
      params: query
    })
  }
  
 //新增告警
  export const addObj = (obj) => {
    return request({
      url: '/resource​/product/warning',
      method: 'post',
      data: obj
    })
  }
  
  //更新告警
  export const updateObj = (obj) => {
    return request({
      url: '/resource​/product/warning',
      method: 'put',
      data: obj
    })
  }
  
  //删除告警
  export const delObj = (productId) => {
    return request({
      url: '/resource​/product/warning/' + productId,
      method: 'delete'
    })
  }

  //启用产品告警
  export const release = (warningId) => {
    return request({
      url: '/resource​/product/warning/release/' + warningId,
      method: 'post'
    })
  }

   //停用产品告警
   export const unRelease = (warningId) => {
    return request({
      url: '/resource​/product/warning/unRelease/' + warningId,
      method: 'post'
    })
  }

